package com.own.actions;

import com.opensymphony.xwork2.ActionSupport;
import com.own.service.ILoginService;

public class LoginAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ILoginService loginService;  
    private String userName;  
    private String userPassword;  
    
    public ILoginService getLoginService() {
		return loginService;
	}
	public void setLoginService(ILoginService loginService) {
		this.loginService = loginService;
	}  
    public String getUserName() {  
        return userName;  
    }  
    public void setUserName(String userName) {  
        this.userName = userName;  
    }
    public String getUserPassword() {
		return userPassword;
	}
	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}
    @Override  
    public String execute() throws Exception {  
        if(loginService.isLogin(userName, userPassword))  
            return SUCCESS;  
        else  
            return INPUT;  
    }
	
	
}
